#include <QtGui/QHBoxLayout>

#include "resourcetreeview.h"

ResourceTreeView::ResourceTreeView(QWidget *parent) : QWidget(parent)
{
    QHBoxLayout *layout = new QHBoxLayout(this);

    layout->setMargin(0);
    layout->setSpacing(0);
    setLayout(layout);

    m_editor = new SharedTools::QrcEditor;

    connect(m_editor, SIGNAL(dirtyChanged(bool)), this, SIGNAL(dirtyChanged()));

    layout->addWidget(m_editor);

    setAutoFillBackground(true);

    QPalette pal = palette();
    pal.setColor(QPalette::Background, Qt::white);
    setPalette(pal);
}

ResourceTreeView::~ResourceTreeView()
{

}

bool ResourceTreeView::load(const QString &file)
{
    return m_editor->load(file);
}

bool ResourceTreeView::save()
{
    return m_editor->save();
}

bool ResourceTreeView::isDirty() const
{
    return m_editor->isDirty();
}

QString ResourceTreeView::contents() const
{
    return "";
}

